package com.onemileshop.entiy;

import java.util.ArrayList;
import java.util.List;

import com.onemileshop.entiy.model.EShopInfo;

import android.R.bool;
import android.R.string;
import android.app.Application;

public class Session extends Application
{
   private static Session instance=null;
   public static synchronized Session getInstance()
   {
	  if(instance==null)
		 instance=new Session();
	  return instance;
   }
   
  
   @Override
   public void onCreate()
   {
	  super.onCreate();
	  instance=(Session)getApplicationContext();
   }

   private boolean IsDEBUG = false;

   private String UserName;
   private String UserKey;
   private int UserId;
   private String ShopName;
   private String ShopId;

   private EShopInfo shop;

   public EShopInfo getShopInfo()
   {
      return shop;
   }


   public void setShopInfo(EShopInfo _shop)
   {
      this.shop = _shop;
   }


   public boolean IsDEBUG()
   {
	  return IsDEBUG;
   }

   public void setDEBUG()
   {
	  IsDEBUG = true;
   }


   public String getUserName()
   {
	  return UserName;
   }

   public void setUserName(String userName)
   {
	  UserName = userName;
   }

   public String getUserKey()
   {
	  return UserKey;
   }

   public void setUserKey(String userKey)
   {
	  UserKey = userKey;
   }

   public int getUserId()
   {
	  return UserId;
   }

   public void setUserId(int userId)
   {
	  UserId = userId;
   }



   public String getShopName()
   {
      return ShopName;
   }

   public void setShopName(String _ShopName)
   {
	  ShopName = _ShopName;
   }

   public String getShopId()
   {
      return ShopId;
   }

   public void setShopId(String _ShopId)
   {
	  ShopId = _ShopId;
   }

   public boolean isLogin()
   {
	  if (UserName == null || UserName.equals(""))
	  {
		 return false;
	  }
	  else
	  {
		 return true;
	  }
   }
   
   public void Logout()
   {
	   UserName=null;
	   UserKey=null;
	   ShopName=null;
	   ShopId=null;
	  if(instance!=null)
	  {
		 instance=null;
	  }
   }

}
